<template>
  <div class="goodsDetail">
    <div class="flex_align">
      <div class="mr20">
        <span class="color_494949 ft12 pr5">{{ translate('合同编码') }}：</span>
        <el-input v-model="formInfo.ContractCode" class="w200" />
      </div>
      <div class="mr20">
        <span class="color_494949 ft12 pr5">{{ translate('合同名称') }}：</span>
        <el-input v-model="formInfo.ContractName" class="w200" />
      </div>
      <div class="mr20">
        <span class="color_494949 ft12 pr5">{{ translate('合同金额') }}：</span>
        <el-input v-model="formInfo.ContractMoney" class="w200" type="number" />
      </div>
    </div>
    <div class="flex_align mt20">
      <div class="mr20">
        <span class="color_494949 ft12 pr5">{{ translate('委托单位') }}：</span>
        <el-select
          v-model="formInfo.ContractEntrustingUnit"
          class="w200"
          :placeholder="translate('请选择')"
        >
          <el-option
            v-for="item in options"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </div>
      <div class="mr20">
        <span class="color_494949 ft12 pr5">{{ translate('合同类型') }}：</span>
        <el-input v-model="formInfo.ContractType" class="w200" />
      </div>
      <div class="mr20">
        <span class="color_494949 ft12 pr5">{{ translate('起草日期') }}：</span>
        <el-date-picker v-model="formInfo.ContractDraftDate" />
      </div>
    </div>
    <div class="flex_align mt20">
      <div class="mr20">
        <span class="color_494949 ft12 pr5">{{ translate('合同保密') }}：</span>
        <el-input v-model="formInfo.ContractSecrecy" class="w200" />
      </div>
      <div class="mr20">
        <span class="color_494949 ft12 pr5">{{ translate('合同交付') }}：</span>
        <el-input v-model="formInfo.ContractDeliver" class="w200" />
      </div>
      <div class="mr20">
        <span class="color_494949 ft12 pr5">{{ translate('社会效应') }}：</span>
        <el-input v-model="formInfo.ContractSocialResults" class="w200" />
      </div>
    </div>
    <div class="flex_align mt20">
      <div class="mr20">
        <span class="color_494949 ft12 pr5">{{ translate('合同风险') }}：</span>
        <el-input v-model="formInfo.ContractRisk" class="w200" />
      </div>
      <div class="mr20">
        <span class="color_494949 ft12 pr5">{{ translate('项目名称') }}：</span>
        <el-input v-model="formInfo.ProjectName" class="w200" />
      </div>
      <div class="mr20">
        <span class="color_494949 ft12 pr5">{{ translate('合同状态') }}：</span>
        <el-select
          v-model="formInfo.ContractState"
          class="w200"
          :placeholder="translate('请选择')"
        >
          <el-option
            v-for="item in optionsW"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </div>
    </div>
    <div class="flex_align mt20">
      <div class="mr20">
        <span class="color_494949 ft12 pr5">{{ translate('是否启用') }}：</span>
        <el-switch
          v-model="formInfo.Enabled"
          :active-value="1"
          :inactive-value="0"
        />
      </div>
      <div class="mr20">
        <span class="color_494949 ft12 pr5">
          {{ translate('创建人电话') }}：
        </span>
        <el-input
          v-model="formInfo.CreateUserPhone"
          class="w200"
          type="number"
        />
      </div>
    </div>
    <div class="flex_align mt20">
      <div class="mr20">
        <span class="color_494949 ft12 pr5">{{ translate('开票要求') }}：</span>
        <el-input v-model="formInfo.ContractBilling" class="w824" />
      </div>
    </div>
    <div class="flex_align mt20">
      <div class="mr20">
        <span class="color_494949 ft12 pr5">{{ translate('汇款要求') }}：</span>
        <el-input v-model="formInfo.ContractPayment" class="w824" />
      </div>
    </div>
    <div class="flex_align mt20">
      <div class="mr20">
        <span class="color_494949 ft12 pr5">{{ translate('合同要求') }}：</span>
        <el-input v-model="formInfo.ContractRequirement" class="w824" />
      </div>
    </div>
  </div>
</template>
<script>
  import { translate } from '@/i18n'
  export default {
    name: 'Detail',
    components: {},
    props: {
      form: {
        type: Object,
        default: () => {
          return {}
        },
      },
      chileddetail: {
        type: Array,
        default: () => {
          return []
        },
      },
    },
    emits: ['deletedchild'],
    data() {
      return {
        WmsData: [], // 选择物资数据
        formInfo: this.form,
        dialogChiled: false,
        layout: 'total, sizes, prev, pager, next, jumper',
        options: [],
        optionsW: [
          {
            label: translate('进行中'),
            value: '1',
          },
          {
            label: translate('已结束'),
            value: '0',
          },
          {
            label: translate('未生效'),
            value: '2',
          },
        ],
      }
    },
    watch: {
      form: {
        handler(val) {
          this.formInfo = val
        },
      },
    },
    methods: {
      translate(row) {
        return translate(row)
      },
    },
  }
</script>
<style lang="scss" scoped>
  .goodsDetail {
    min-height: 400px;
  }
  .flex_align {
    display: flex;
    align-items: center;
  }
  .tableDetail {
    padding: 10px;
    .button-add {
      text-align: end;
      padding: 10px;
    }
  }
  .mr20 {
    margin-right: 20px;
  }

  .w200 {
    width: 215px !important;
  }
  .mt20 {
    margin-top: 20px;
  }
  .mr10 {
    margin-right: 10px;
  }
  .w320 {
    width: 320px;
  }
  .w824 {
    width: 824px;
  }
  .w140 {
    // display: inline-block;
    // width: 120px;
  }
  ::v-deep .el-scrollbar__wrap {
    overflow-x: auto;
    height: calc(100% + 20px); //多出来的20px是横向滚动条默认的样式
  }
  ::v-deep .el-scrollbar .el-scrollbar__wrap .el-scrollbar__view {
    white-space: nowrap;
    display: inline-block;
  }
  ::v-deep .el-table--scrollable-x .el-table__body-wrapper {
    overflow-x: hidden;
  }
  ::v-deep input[type='number']::-webkit-inner-spin-button,
  ::v-deep input[type='number']::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
  }
</style>
